Skip to content

refactor: replace rolling-hash transcript with spongefish NARG protocol#17

Open
shreyas-londhe wants to merge 3 commits intoa16z:mainfrom
shreyas-londhe:feat/spongefish-1-core
Open

refactor: replace rolling-hash transcript with spongefish NARG protocol#17
shreyas-londhe wants to merge 3 commits intoa16z:mainfrom
shreyas-londhe:feat/spongefish-1-core

Conversation

@shreyas-londhe
Copy link
Copy Markdown

@shreyas-londhe shreyas-londhe commented Mar 6, 2026

Summary

Replace Blake2b rolling-hash Fiat-Shamir transcript with upstream spongefish v0.5.1 duplex-sponge construction. Proofs become opaque NARG byte strings — no separate Proof struct.

Breaking change: Proof format is incompatible with previous versions.

Core changes

  • Add upstream spongefish dependency (arkworks-rs/spongefish tag v0.5.1, features: ark-ec, sha3)
  • New ProverTranscript/VerifierTranscript traits abstracting the sponge API
  • domain.rs — domain separator with instance encoding (nu, sigma, zk flag)
  • spongefish_codecs.rs — trait impls mapping ProverState/VerifierState to Dory's transcript traits
  • Commitment (GT), evaluation (Fr), and point coordinates bound as public_message into the sponge state for Fiat-Shamir domain separation

Removed

  • blake2b_transcript.rs, ark_proof.rs, proof.rs, VMVMessage
  • Runtime pattern enforcement (CheckedProverState, CheckedVerifierState, PatternBuilder)

Tests & examples

  • All tests, benchmarks, and examples migrated to upstream ProverState/VerifierState
  • Soundness tests cover byte-level NARG tampering
  • 71 tests pass, clippy clean

Replace the custom Blake2b rolling-hash transcript with spongefish's
duplex-sponge construction. Proofs are now opaque NARG byte strings
instead of serialized Proof structs.

Key changes:
- Add CheckedProverState/CheckedVerifierState with InteractionPattern
  enforcement for compile-time protocol structure validation
- Declare reusable sub-patterns (sigma1, sigma2, reduce round, scalar
  product) composed via scoped nesting for diagnostic paths
- Domain separator binds (sigma, zk) into sponge instance
- Remove Proof struct, blake2b transcript, ark_proof, VMVMessage
- Add check_eof() to all tests, benches, and examples
- Use macros to reduce spongefish codec boilerplate
- Pin spongefish to commit 45df37a7 on fork

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace Blake2b rolling-hash Fiat-Shamir with spongefish duplex-sponge
(upstream arkworks-rs/spongefish v0.5.1). Proofs become opaque NARG byte
strings. Bind commitment, evaluation, and point as public messages into
the sponge state for defense-in-depth Fiat-Shamir domain separation.
Migrate all call sites to upstream ProverState/VerifierState. Remove
check_complete() calls (pattern enforcement dropped). Proof extraction
is now prover.narg_string().to_vec() directly.
@shreyas-londhe shreyas-londhe force-pushed the feat/spongefish-1-core branch from cf0490f to 16364e8 Compare April 6, 2026 06:30
@shreyas-londhe shreyas-londhe changed the title refactor: replace transcript with spongefish NARG protocol refactor: replace rolling-hash transcript with spongefish NARG protocol Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant